package com.hejielife.producerconsumer4;

/**
 * 2019年8月2日 下午2:27:32
 * 
 * @author hejielife
 * @despribe Main 可以撤销的任务
 */
public class Main {
	public static void main(String[] args) {
		Thread executor = new Thread() {
			public void run() {
				System.out.println("Host.execute BEGIN");
				try {
					Host.execute(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				System.out.println("Host.execute END");
			}
		};

		executor.start();

		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
		}

		System.out.println("***** interrupt *****");
		executor.interrupt();
	}
}
